/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication4.model;


import java.util.ArrayList;
import javaapplication4.model.observer.Observable;

/**
 *
 * @author mathieubakrim
 */
public class AddressBook extends AbstractModel{
    //protected ArrayList<Contact> contactsList = new ArrayList<Contact>();

    @Override
    public String toString() {
        return null;//return "AddressBook{" + "contactsList=" + contactsList + '}';
    }
    
    //Create a contact
    public Contact createContact(String ln, String fn, String pn, String ap, String ape, String hp, String ep, String epe) {
        Contact c = new Contact(ln, fn, pn, ap, ape, hp, ep, epe);
        //contactsList.add(c);
        notifyObserver(String.valueOf(this.toString()));
        
        //System.out.println("Test de creation de contact dans AdressBook.java :");
        //System.out.println(contactsList.get(0).toString());
        return c;
    }

    //Delete a contact
    public void deleteContact(Contact c){
        //contactsList.remove(c);
    }
    
    //edit a contact
    public void editContact(Contact cOld, Contact cNew){
        //contactsList.remove(cOld);
        //contactsList.add(cNew);
        notifyObserver(String.valueOf(this.toString()));
    }
    
    //Show contact details
    public String showDetails(Contact c){
        return c.toString();
    }
    
    // Show all contacts, alphabeticallly
    public ArrayList<Contact> showAlphaList(){
        //ArrayList<Contact> aList = contactsList;
        
        
        return null;//return aList; // Todo : le tri directement dans une JTABLE
    }
    
    // Show all contacts, per virtual Group
    public ArrayList<Contact> showGroupList(){
       // ArrayList<Contact> gList = contactsList;
        
        return null;//gList; // Todo : le tri directement dans une JTABLE
    }
    
    // Show all contacts, per creation date
    public ArrayList<Contact> showDateList(){
        //ArrayList<Contact> dList = contactsList;
        
        return null;//dList; // Todo : le tri directement dans une JTABLE
    }


    
    
}
